Spatiotemporal method for anomaly detection in dictionary learning and sparse signal recognition

ABSTRACT

A method for constructing a dictionary to represent data from a training data set comprising: modeling the data as a linear combination of columns; modeling outliers in the data set via deterministic outlier vectors; formatting the training data set in matrix form for processing; defining an underlying structure in the data set; quantifying a similarity across the data; building a Laplacian matrix; using group-Lasso regularizers to succinctly represent the data; choosing scalar parameters for controlling the number of dictionary columns used to represent the data and the number of elements of the training data set identified as outliers; using BCD and PG methods on the vector-matrix-formatted data set to estimate a dictionary, corresponding expansion coefficients, and the outlier vectors; and using a length of the outlier vectors to identify outliers in the data.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of U.S. Provisional Application No. 62/315,580, filed 30 Mar. 2016, titled “Spatiotemporal Methods for Anomaly Detection in Dictionary Learning and Sparse Regression”.

FEDERALLY-SPONSORED RESEARCH AND DEVELOPMENT

The United States Government has ownership rights in this invention. Licensing and technical inquiries may be directed to the Office of Research and Technical Applications, Space and Naval Warfare Systems Center, Pacific, Code 72120, San Diego, Calif., 92152; voice (619) 553-5118; ssc_pac_t2@navy.mil.

BACKGROUND OF THE INVENTION

Succinct representations of data (especially high-dimensional data) are paramount to promptly extract actionable information and reduce the storage and communication requirements related to sharing and archiving data. A fundamental observation, first made in the image processing community, is that a more efficient signal representation is possible if one uses an over-complete dictionary learned from the signals themselves rather than a fixed basis. Given a large number of signal samples, the dictionary learning problem aims to construct a dictionary that can be used to efficiently represent the data as a linear combination of its columns, also known as atoms. In this context, a more efficient data representation is one that uses a smaller number of atoms to achieve the desired signal reconstruction quality.

Usually, the dictionary is learned by fitting training data to a linear model representation for the data via a regularized least-squares criterion, where regularization is used to encourage a sparse structure in the vectors of regression coefficients. Naturally, the data samples used for learning the dictionary are assumed to adhere to the nominal process that generated the data. However, in many cases it is not possible to screen all data samples to guarantee that no datum behaves as an outlier, that is, deviates significantly from the remaining data. A new method is needed for robust dictionary learning.

SUMMARY

Disclosed herein is a method for constructing a dictionary to succinctly represent data from a training data set that comprises the following steps. The first step provides for modeling the data as a linear combination of columns of the dictionary. The next step provides for modeling a presence of outliers in the data set via deterministic outlier vectors that will take nonzero values for data vectors that are deemed outliers only. The next step provides for formatting the training data set in matrix form for processing. The next step provides for defining an underlying structure in the data set. The next step provides for quantifying a similarity across the data according to the underlying structure. The next step provides for building a Laplacian matrix from the matrix-formatted data set. The underlying data structure is captured within the Laplacian matrix. The next step provides for using Lasso and group-Lasso regularizers to succinctly represent the data as a linear combination of columns of the dictionary. The next step provides for choosing scalar parameters for controlling the number of dictionary columns used to represent the data and the number of elements of the training data set identified as outliers. The next step provides for using block coordinate descent and proximal gradient methods on the vector-matrix-formatted data set to estimate a dictionary that efficiently represents each datum in the training data set as a linear combination of a subset of dictionary columns, corresponding expansion coefficients, and the outlier vectors. The next step provides for using a length of the outlier vectors to identify outliers in the data.

BRIEF DESCRIPTION OF THE DRAWINGS

Throughout the several views, like elements are referenced using like references. The elements in the figures are not drawn to scale and some dimensions are exaggerated for clarity.

FIG. 1 is a flowchart of a method for constructing a dictionary from a dataset.

FIG. 2 shows three images of a walkway and illustrates a spatial structure captured in a matrix.

FIG. 3 is a graph of cost data vs. iterations during execution of an algorithm.

FIG. 4 is a graph of cost data vs. iterations during execution of an algorithm.

FIGS. 5A-5F are images of a walkway highlighting discovered anomalies.

FIG. 6 is an illustration highlighting digits that were deemed to be outliers in a training data set.

FIG. 7 is a graph showing Precision-Recall curves.

DETAILED DESCRIPTION OF EMBODIMENTS

The disclosed methods below may be described generally, as well as in terms of specific examples and/or specific embodiments. For instances where references are made to detailed examples and/or embodiments, it should be appreciated that any of the underlying principles described are not to be limited to a single embodiment, but may be expanded for use with any of the other methods described herein as will be understood by one of ordinary skill in the art unless otherwise stated specifically.

FIG. 1 is a flowchart of a method 10 for constructing a dictionary to succinctly represent data from a training data set that comprises, consists of, or consists essentially of the following steps. The first step 10 _(a) provides for modeling the data as a linear combination of columns of the dictionary. The next step 10 _(b) provides for modeling the presence of outliers in the data set via deterministic outlier vectors, which will take nonzero values for data vectors that are deemed outliers only. The next step 10 _(c) provides for formatting the training data set in matrix form for processing. The next step 10 _(d) provides for defining an underlying structure in the data set. The next step 10 _(e) provides for quantifying a similarity across the data according to the underlying structure. The next step 10 _(f) provides for building a Laplacian matrix from the matrix-formatted data set. The underlying data structure is captured within the Laplacian matrix. The next step 10 _(g) provides for using Lasso and group-Lasso regularizers to succinctly represent the data as a linear combination of columns of the dictionary. The next step 10 _(h) provides for choosing scalar parameters for controlling the number of dictionary columns used to represent the data and the number of elements of the training data set identified as outliers. The next step 10 _(i) provides for using block coordinate descent (BCD) and proximal gradient (PG) methods on the vector-matrix-formatted data set to estimate a dictionary that efficiently represents each datum in the training data set as a linear combination of a subset of dictionary columns, corresponding expansion coefficients, and the outlier vectors. The next step 10 _(j) provides for using a length of the outlier vectors to identify outliers in the data.

An embodiment of method 10 establishes a universal framework for anomaly detection that does not rely on the statistical distribution of anomalies in the dataset. Once outliers have been identified in a data set, they may be removed from the data set. Then, the outlier-free data set may be used to learn a new dictionary and the corresponding vectors of expansion coefficients via the same BCD and PG methods, with all outlier vectors set to zero.

In a given dataset, outliers alone may be more informative than the remaining data, in which case one would like to quickly identify them and possibly remove them from the dataset. The regularized least-squares (LS) criterion is sensitive to the presence of outliers. Dictionary learning (DL) problem formulations based on the LS cost inherit such sensitivity and are, thus, sensitive to outliers, which can bias the dictionary estimate and reduce the efficiency of DL as a data compression tool.

Instead of using the LS criterion as an error fitting term, robust DL approaches leverage tools developed in the area of robust statistics and use criteria such as the l₁-error and the Huber loss to induce robustness to outliers. Unfortunately, previous robust DL approaches do not lend themselves for constructing efficient solvers, and in many cases they do not directly identify the outliers. In an embodiment of dictionary construction method 10, robust analysis methods for data capitalizing on modern signal processing tools is used to leverage a data model that captures the presence of outliers, and the fact that by definition outliers are rare, to develop efficient tools for identifying and tapering the effects of outliers. When there is a structural relationship among elements of the training set, outliers can inherit such a structure. For instance, when training a dictionary using image patches contaminated by outliers, the spatial structure of the patches (size and location) induces a similar structure in the outliers. Dictionary construction method 10 leverages outlier structure to enhance the robustness of the resulting dictionary and to identify outliers. An embodiment of method 10 may be described as a robust DL framework that capitalizes on sparsity-aware modeling tools and the predefined structure among outliers. The specific outlier structure may be defined via an undirected graph subsuming the similarity among elements of the training set. This information may be introduced in the robust DL problem via a Laplacian regularization term that now couples all outlier vector representations. A BCD algorithm coupled with PG methods may be used for training the dictionary and identifying the outliers. The data set may be partitioned and vectorised in order to format the data in matrix form. Dictionary construction method 10 uses known structure from the dataset, or application domain, as a means to develop enhanced anomaly detection algorithms applicable to a wide range of signal domains. The methodology is able to capture spatiotemporal structures in the data and deal with datasets that are high dimensional and large.

Consider a training set of M-dimensional real-valued vectors

:={y_(n)}_(n=1) ^(N) with cardinality N:=|

|. Let D:=[d₁, . . . , d_(Q)]∈

^(M×Q) denote a dictionary with Q atoms, where an atom corresponds to a column of D. It is assumed that each y_(n) can be represented as a linear combination of atoms from D. Whenever Q>M, D is called overcomplete. If D is overcomplete, vectors {d_(q)}_(q=1) ^(Q) are linearly dependent. Then, the vector of expansion coefficients s_(n) in y_(n)=Ds_(n) is not unique for any n. By requiring each s_(n) to be sparse, a balance can be stricken between the quality of the approximation and the stability of the representation of each y_(n).

Given

, the goal of the classical DL problem is to find both D and {s_(n)}_(n=1) ^(N) as the minimizers of

$\begin{matrix} \left. {\min\limits_{{D \in \mathcal{D}},{\{ s_{n}\}}_{n = 1}^{N}}{\frac{1}{2}\sum\limits_{n = 1}^{N}}}\;||{y_{n} - {Ds}_{n}}\mathop{\text{||}}_{2}^{2}{{+ \eta}\sum\limits_{n = 1}^{N}}\;||s_{n} \right.||_{1} & (1) \end{matrix}$ where

:={D∈

^(M×Q):∥d_(q)∥₂≤1,∀q}, η>0 is a tuning parameter, and ∥s_(n)∥₁:=Σ_(q=1) ^(Q)|s_(n,q)| represents the l₁-norm of s_(n) with s_(n,q):=[s_(n)]_(q). The l₁-norm regularizer encourages sparsity on the s_(n)'s and η controls the sparsity level of the resulting s_(n)'s. (As used herein, the notation “'s” used after a term such as s_(n) is meant to indicate plurality.) The constraints on the size of the columns of D defined in

are necessary to avoid dictionary atoms to grow unbounded and the corresponding entries of each s_(n) approach zero.

Problem (1) is non-convex and may be solved with a BCD-based solver, which iteratively updates D with {s_(n)}_(n=1) ^(N) fixed, and then updates all {s_(n)}_(n=1) ^(N) with D fixed. This BCD solver solves a constrained LS optimization problem to update the dictionary, and is thus sensitive to the presence of outliers in

. Note that in the aforementioned BCD solver the updates for the s_(n)'s are also adversely impacted by outliers both through the outlier-sensitive D and the optimization criterion used. Further discussion of a BCD approach is disclosed in M. Elad's article “Sparse and Redundant Representations: From Theory to Applications in Signal and Image Processing,” New York: Springer 2010, which article is incorporated by reference herein in its entirety.

The following describes a sparse and structured process for modeling outliers in a dataset. First, a model for each y_(n)∈

that explicitly captures the presence of outliers in the training data set

is introduced. To this end, each y_(n)∈

is modeled as y _(n) =Ds _(n) +o _(n)+ϵ_(n) ,n=1, . . . ,N  (2) where o_(n) denotes a deterministic outlier vector, and ϵ_(n) denotes a inlier noise vector affecting y_(n). If y_(n) is an outlier, then o_(n) takes a nonzero value and lessens the effect of y_(n) on D; otherwise, o_(n)=0_(N), where 0_(N) is an N×1 vector of zeros. Solving for the tuple (D, {s_(n), o_(n)}_(n=1) ^(N)) using the set of equations in (2) entails solving a nonlinear and under-determined system of P equations with N(M+Q)+MQ unknowns. Thus, auxiliary information about the structure of each s_(n) and the {o_(n)}_(n=1) ^(N), and on the proportion of outliers present in

becomes essential to obtain a stable estimate for (D, {s_(n), o_(n)}_(n=1) ^(N)) and avoid over-fitting the model in (2).

The structural information about the outliers may be summarized by an auxiliary weighted graph

(V, E). The set V defines the vertex set, with cardinality |V|=N, where each vertex is associated with an o_(n). The set E defines the edge set whose elements define the structure of the o_(n)'s and the similarity of each pair of o_(n)'s. The connectivity of

is compactly summarized by the adjacency matrix W∈

^(N×N), where an entry w_(n,n′):=[W]_(n,n′)>0 if nodes v_(n), v_(n′)∈V are connected in

, and w_(n,n′)=0 otherwise. The topology of

, and thus the underlying structure associated with the outliers, is encapsulated in the Laplacian matrix L:=diag(W1_(N))−W, where l_(N) denotes an N×1 vector of ones and diag(y_(n)) a diagonal matrix with y_(n) on its main diagonal. Note that

does not have to be connected.

Usually DL seeks sparse expansion coefficient vectors {s_(n)}_(n=1) ^(N). Moreover, outliers by definition are rare and, thus, few of them are assumed to be present in

. The sparse presence of outliers in equation (2) can be quantified through the support of the vector [∥o₁∥₂, . . . , ∥o_(N)∥₂]. Let O:=[o₁, . . . , o_(N)]∈

^(Q×N) denote a matrix of outlier vectors, S:=[s₁, . . . , s_(N)]∈∥

^(Q×N) a matrix of expansion coefficient vectors, and ∥O∥_(2,p):=∥[∥o₁∥₂, . . . , ∥o_(N)∥₂]∥_(p), where ∥o_(n)∥_(p):=(Σ_(m=1) ^(M)|o_(m,n)|^(p))^(1/p) represents the l_(p)-norm of o_(n) with o_(m,n):=[o_(n)]_(m) and p∈[1, ∞). An estimator for (D, S, O) that captures the spatial structure of the outliers is given by the solution of

$\begin{matrix} \left. {\min\limits_{{D \in \mathcal{D}},S,O}{\frac{1}{2}\sum\limits_{n = 1}^{N}}}\;||{y_{n} - {Ds}_{n} - o_{n}}\mathop{\text{||}}_{2}^{2}{+ {\quad\left. {\eta\sum\limits_{n = 1}^{N}}\;||s_{n}||{}_{1}{+ \lambda}||O||{}_{2,1}{{+ \frac{\mu}{2}}{{Tr}\left( {OLO}^{\prime} \right)}} \right.}} \right. & (3) \end{matrix}$ where Tr(⋅) denotes the matrix trace operator, η>0 is a tuning parameter that controls the sparsity of the s_(n)'s λ>0 a tuning parameter that controls the number vectors in

identified as outliers, and μ>0 a tuning parameter that controls how much emphasis is placed on the structural relation among outliers. The group Lasso regularizer in equation (3) encourages entire o_(n) vectors to be set to zero. The Laplacian regularization term in equation (3) can be explicitly written as

$\begin{matrix} {{{Tr}\left( {OLO}^{\prime} \right)} = {\frac{1}{2}{\sum\limits_{m = 1}^{M}\;{\left\lbrack {\sum\limits_{n = 1}^{N}\;{\sum\limits_{n^{\prime} = 1}^{N}\;{w_{n,n^{\prime}}\left( {o_{m,n} - o_{m,n^{\prime}}} \right)}^{2}}} \right\rbrack.}}}} & (4) \end{matrix}$ From equation (4), it follows that the Laplacian regularization term in equation (3) encourages o_(n)'s to be similar to each other if they are connected in

.

In general, equation (3) is a non convex optimization problem which is difficult to solve. Nevertheless, when optimizing with respect to any one of D, S, and O with the other two fixed, the resulting optimization problems can be solved efficiently. DL-alternate formulations that rely on a constrained version of equation (3), where the l₀-“norm” is used in lieu of the f_(j)-norm, and bestow structure on the dictionary's atoms may be used. There are no general rules for choosing between any of these DL formulations and the selection often depends on the specific problem at hand. Our outlier model in equation (2) and the Laplacian regularizer in equation (4) can be used to develop robust versions of these DL approaches. The resulting robust and structure DL approaches are able to capture the underlying structure of the outliers after appropriately modifying the algorithmic framework outlined next.

The following algorithm is an embodiment of a BCD solver for equation (3). This embodiment capitalizes on the observation that efficient solvers may be realized for updating one of D, S, or O when the other two optimization variables are fixed. Equation (3) is convex with respect to D and O individually. With f(D, S, O) denoting the objective function in equation (3), the proposed BCD algorithm minimizes f(D, S, O) with respect to each optimization block, namely D, S, or O, one at a time. Let k denote the BCD-iteration index. Our robust DL algorithm is summarized by the following iterations:

$\begin{matrix} {{\hat{D}}^{(k)} = {\begin{matrix} {\arg\mspace{14mu}\min} \\ {D \in \mathcal{D}} \end{matrix}{f\left( {D,{\hat{S}}^{({k - 1})},{\hat{O}}^{({k - 1})}} \right)}}} & \left( {6a} \right) \\ {{\hat{S}}^{(k)} = {\begin{matrix} {\arg\mspace{14mu}\min} \\ S \end{matrix}{f\left( {{\hat{D}}^{(k)},S,{\hat{O}}^{({k - 1})}} \right)}}} & \left( {6b} \right) \\ {{\hat{O}}^{(k)} = {\begin{matrix} {\arg\mspace{14mu}\min} \\ O \end{matrix}{f\left( {{\hat{D}}^{(k)},{\hat{S}}^{(k)},O} \right)}}} & \left( {6c} \right) \end{matrix}$

where {circumflex over (D)}^((k)), Ŝ^((k)), and Ô^((k)) denote estimates for D, S, and O at iteration k, respectively.

Algorithm 1 BCD algorithm for dictionary update in (6a) Require: y and tuple ({circumflex over (D)}^((k−1)), Ŝ^((k−1)), Ô^((k−1))). 1: Let D^((υ)) := [d₁ ^((υ)), . . . , d_(Q) ^((υ))] and ŝ_(q, n) ^((k−1)) := [Ŝ^((k−1))]_(q, n). 2: Use υ as BCD iteration index and set D⁽⁰⁾ = {circumflex over (D)}^((k−1)). 3: for = 1, 2, . . . , γ do 4:  for q = 1, . . . , Q do 5:   Update each atom in D^((υ)) as   $r_{q,n}^{({\upsilon,{k - 1}})} = {y_{n} - o_{n}^{({k - 1})} - {\sum\limits_{\underset{q^{\prime} \neq q}{q^{\prime} = 1}}^{Q}{{\hat{s}}_{q^{\prime},n}^{({k - 1})}d_{q^{\prime}}^{({\upsilon - 1})}}}}$ (5a)     $u_{q}^{(\upsilon)} = {\left\lbrack {\sum\limits_{n = 1}^{N}\left( {\hat{s}}_{q,n}^{({k - 1})} \right)^{2}} \right\rbrack^{- 1}\left\lbrack {\sum\limits_{n = 1}^{N}{{\hat{s}}_{q,n}^{({k - 1})}r_{q,n}^{({\upsilon,{k - 1}})}}} \right\rbrack}$ (5b)     $d_{q}^{(\upsilon)} = \frac{u_{q}^{(\upsilon)}}{\min\;\left\{ {1,{u_{q}^{(\upsilon)}}_{2}} \right\}}$ (5c) 6:  end for 7: end for 8: return {circumflex over (D)}^((k)) = D^((γ)).

Updating D^((k)) in (6a) may be done via a BCD algorithm iterating over the columns of D. Per BCD iteration, each atom of D is updated with all other atoms fixed by solving the resulting unconstrained LS optimization problem. This BCD algorithm is summarized as Algorithm 1 above. Note that for (5b) to be well-defined, each atom in {circumflex over (D)}^((k−1)) must be used by at least one s_(n). In practice, every unused atom of the dictionary is updated to a randomly chosen element of

in before running Algorithm 1 and (5b) is skipped for such an atom when updating the dictionary. If there are no unused atoms, Algorithm 1 is guaranteed to achieve the minimum of the cost in (6a).

The update in (6b) decouples per column of S. The resulting set of optimization problems are convex and correspond to the Lagrangian version of the least-absolute shrinkage and selection operator, such as is described in R. Tibshirani's article “Regression shrinkage and selection via the lasso” (Journal of the Royal Statistical Society, 1996. These optimization problems can be efficiently solved via, e.g., BCD or an alternating direction method of multipliers, such as is described by M. Elad in the article “Sparse and Redundant Representation: From Theory to Applications in Signal and Image Processing”, 2010 and by D. P. Bertsekas in the article “Nonlinear Programming, 1999. The update in (6c) entails solving a convex optimization problem. However, tackling (6c) in its current form leads to solvers whose computational complexity can be high due to the coupling across o_(n)'s caused by the Laplacian regularizer.

Equation (6c) may be solved via a PG algorithm such as Algorithm 2, which is shown below.

Algorithm 2 PG algorithm for solving (6c) Require: y, ({circumflex over (D)}^((k)), Ŝ^((k)), {hacek over (O)}^((k−1))), and μ, λ, Λ > 0.  1: Let O^((τ)) := [o₁ ^((τ)),..., o_(N) ^((τ))].  2: Use τ as PG iteration index and set O⁽¹⁾ = Ô^((k−1)).  3: for τ = 1,2,...,T do  4: for n = 1,...,N do  5: Compute ω_(n)(O^((τ))) via (7a).  6: Compute h_(n)(O^((τ))) via (7b).  7: Update o_(n) ^((τ)) via (9).  8: end for  9: end for 10: return Ô^((k)) = O^((T)). Although the resulting solver (i.e., Algorithm 2) for (6c) is iterative in nature, it features fast convergence when compared to other first order optimization methods such as gradient descent and BCD. Moreover, the updates are decomposable across each o_(n). Hence, they can be parallelized. The PG algorithm 2 for updating (6c) at iteration k relies on the following:

$\begin{matrix} {{{\omega_{n}\left( O^{(\tau)} \right)}\mspace{14mu}\text{:=}}\mspace{14mu} - \left( {y_{n} - {{\hat{D}}^{(k)}{\hat{s}}_{n}^{(k)}} - o_{n}^{(\tau)}} \right) + {\mu\; O^{(\tau)}a_{n}}} & \left( {7a} \right) \\ {{{h_{n}^{(k)}\left( O^{(\tau)} \right)}\mspace{14mu}\text{:=}\mspace{14mu} o_{n}^{(\tau)}} - \frac{w_{n}^{(k)}\left( O^{(\tau)} \right)}{\Lambda}} & \left( {7b} \right) \\ {{{\mathcal{g}}^{(k)}\left( {O;O^{({\tau - 1})}} \right)}\mspace{14mu}\text{:=}\mspace{14mu}{\sum\limits_{n = 1}^{N}\;\left\lbrack \left. \frac{1}{2}||{o_{n} - {h_{n}^{(k)}\left( O^{({\tau - 1})} \right)}}\mathop{\text{||}}_{2}^{2}{+ \frac{\lambda}{\Lambda}}||o_{n} \right.||_{2} \right\rbrack}} & \left( {7c} \right) \end{matrix}$ where τ denotes the proximal method iteration index, ω_(n)(O^((τ))) denotes the gradient of the differentiable part of f with respect to o_(n) evaluated at O^((τ)), a_(n) the n-th column of L, and Λ the Lipschitz constant for the gradient (with respect to O) of the differentiable part of f, which corresponds to the largest singular value of I+μL. Our iterative update for computing (6c) is summarized as follows:

$\begin{matrix} {O^{(\tau)} = {\begin{matrix} {\arg\mspace{14mu}\min} \\ o \end{matrix}{{{\mathcal{g}}^{(k)}\left( {O;O^{({\tau - 1})}} \right)}.}}} & (8) \end{matrix}$

This update is separable across o_(n)'s. Computing each o_(n) ^((τ)) is then done in closed form as

$o_{n}^{(\tau)} = {{h_{n}^{(k)}\left( O^{({\tau - 1})} \right)}\left( {1 - \frac{\lambda}{\left. \Lambda||{h_{n}^{(k)}\left( O^{({\tau - 1})} \right)} \right.||_{2}}} \right)_{+}}$ where (⋅)₊:=max{0,⋅}. Note that 1/Λ in (9) can be understood as the step size α of the PG algorithm. From this vantage point, the PG algorithm will converge for any

$\alpha \in {\left( \frac{0,1}{\Lambda} \right\rbrack.}$ It is also possible to choose α at each PG iteration via a line search, such as is known in the art and described in more detail in N. Parikh's and S. Boyd's article “Proximal algorithms,” in “Found. Trends Optimization, vol. 1, pp. 123-231, 2013.

The PG algorithm for solving (6c) may be summarized as Algorithm 2. Each iteration of this PG algorithm can be computed in O (MNQ+MN²) run time, where the quadratic dependency on N stems from the second term in (7a) that defines an operation to be performed for each n. The computational complexity of Algorithm 2 can be reduced after noticing that O^((τ)) is a sparse matrix and often L is a sparse matrix as well. In this case, specialized sparse matrix multiplication algorithms may be used to reduce the run time of (7a) for each n. The PG method outlined by Algorithm 2 converges to the solution of (6c) and features a worst-case convergence rate of O(1/τ).

It is possible to enhance the suboptimal convergence rate of the PG algorithms while maintaining their computational simplicity. From that vantage point, one may develop an accelerated PG (APG) algorithm for solving (6c) which features worst-case convergence rate of O(1/τ²) to the solution of (6c). The resulting APG solver requires a copy of both O^((τ)) and O^((τ−1)). Maintaining a copy of O^((τ−1)) does not add excessive data storage requirements since O^((τ−1)) is column-wise sparse. Similarly to the PG algorithm, each iteration of the APG algorithm can be computed in O (MNQ+MN²) run time and benefits from specialized sparse matrix multiplication algorithms for updating each ω_(n).

FIG. 2 is an illustration of a video imagery dataset on which the robust DL algorithm defined in equations 6(a)-6(c) was tested. The three still images in FIG. 2 were taken from The University of California San Diego's (UCSD's) Anomaly Detection Dataset. Each image was partitioned to multiple blocks and their relative position with respect to each other was used to define an auxiliary graph whose structure is captured by the Laplacian matrix L₀. This spatial structure is illustrated for the n-th block, which is identified as y_(n) in FIG. 2, is illustrated on the left side of FIG. 2. The Laplacian matrix L that captures the structure of the entire dataset

is illustrated on the right side of FIG. 2, where 0 denotes a 551×551 matrix of zeros. The portion of L enclosed by the triangle 16 underscores the fact that L does not capture block structures across images.

The numerical performance of the robust DL algorithm defined in 6(a)-6(c) was tested via numerical tests on two real datasets: UCSD's Anomaly Detection Dataset and on the Resampled United States Postal Service (USPS) dataset. For these tests all algorithms used in this embodiment of method 10 were implemented in Python™ 2.7, which is a high-level, object oriented programming language created by Guido van possum and offered by The Python Foundation. The UCSD Anomaly Detection Dataset data set features video of a pedestrian walkway acquired with a stationary camera and a fixed background. With few exceptions, most portions of the video contain only pedestrians moving along the walkway. Abnormal events include the presence of bikers, skates and small carts. Three images from this dataset were used for this test. (See images A, B, and C shown in FIG. 2) Each image in FIG. 2 was chosen so that the crowd density in the image was low. No artificial anomalies were introduced in these images. Note that one of the images (image B) shows a service cart passing by.

Each image was resized from 158×258 pixels to 152×252 and then partitioned into 8×8 pixel blocks. The resulting N=1,653 blocks (551 per image), were used to construct

⊂

with M=64. Each 64-dimensional y_(n)=

was constructed by vertically stacking the columns of each block. In this test, no further preprocessing was performed on the elements of the training set. In order to capture the spatial structure among blocks per image, an auxiliary graph with N₀=551 nodes was constructed as follows. Each y_(n) was assigned to a node of the graph. The edges for each node were chosen so that each y_(n) is connected to its spatial neighboring blocks only, as shown in FIG. 2, and their corresponding weights were set to unity. Thus, in the resulting graph the degree of each node is either 3 for corner blocks, 5 for border blocks that are not corners, and 8 for all other ones. The connectivity of the graph is summarized by the Laplacian matrix L₀. Finally, L was defined as a block diagonal matrix containing three copies of L₀ on its main block diagonal (see FIG. 2) Note that L does not capture block structures across images. With the current form of L, in this embodiment, method 10 does not rely on any form of temporal information. Such temporal information can, however, be included on the off-diagonal entries of L.

FIG. 3 is a graph showing the cost in equation (3) during the execution of equation (6c) via Algorithm 2. FIG. 4 is a graph showing the cost in equation (3) during the execution of the robust DL algorithm defined by equations 6(a)-6(c). In FIG. 3, which shows the evolution of the cost in equation (3) when updating O via Algorithm 2, the curves were obtained for an early BCD iteration of 6(a)-6(c) and various choices of step size α. Note that the convergence rate of Algorithm 2 was not significantly impacted by the choice of μ. FIG. 4 shows the evolution of the cost in equation (3) during the execution of the BCD algorithm in 6(a)-6(c) for various values of the dictionary size Q.

Referring back to FIG. 3, for illustration purposes only, we used a modified version of Algorithm 2 where a tunable step size α was used in lieu of the factor 1/Λ. The PG algorithm will converge for any

$\alpha \in {\left( \frac{0,1}{\Lambda} \right\rbrack.}$ However, the best convergence rate is achieved by setting α=1/Λ as in Algorithm 2. In practice it was observed that during the first iteration of the BCD algorithm the PG algorithm took less than 20 iterations. As the BCD iterations progressed, the average number of PG iterations required for convergence decreased to around 3-5. FIG. 4 illustrates the convergence rate of the BCD algorithm defined by the updates in 6(a)-6(c) for various values of Q.

FIGS. 5A-5F show blocks of pixels identified as outliers in the images shown in FIG. 2. FIGS. 5A-5C were obtained by setting (λ, μ)=(37.5, 0). In FIGS. 5A-5C, 191 blocks (approximately 12% of the training blocks) were identified as outliers and on average 57% of the entries of each s_(n) were set to zero. FIGS. 5D-5F were obtained by setting (λ, μ)=(36.0, 10). In this case, 207 blocks (approximately 12.5% of the training blocks) were identified as outliers and on average 55% of the entries of each s_(n) were set to zero. For this experiment, a dictionary with Q=64 atoms was used. Parameter η was set to η=3.7 so that on average 36 nonzero entries were chosen for each s_(n). Some of the blocks identified as outliers correspond to the portions of the images displaying pedestrians and the service cart.

It was observed that setting μ>0 encouraged outlier blocks to be chosen according to the structure defined by the matrix L. For instance, in FIG. 5E the outlier blocks corresponding to some of the pedestrians seem to follow more rigidly the spatial structure defined for the elements of

. Finally, although not easily seen in FIGS. 5A-5F, several blocks corresponding to the foliage in the background are picked up as outliers. This can in part be due to the texture richness inherent to foliage and other natural texture images. Using a dictionary with Q>64 and temporal information in L can help alleviate the sensitivity of method 10 to the background texture diversity.

FIG. 6 illustrates the results obtained when using the robust DL algorithm for learning a dictionary with the Resampled USPS dataset and artificially-introduced outliers. The USPS resampled data set is a randomly shuffled version of the USPS handwritten numeral digital data, which had many more training digits than testing digits. This dataset includes 4,696 16×16 training digits, which are stored as 256-dimensional column vectors whose entries range over the interval [−1, 1]. In this test, N=1,000 digits were used for training and artificial anomalies were introduced by coloring a fraction of randomly chosen digits. In order to emulate the red, green, blue (RGB) model for each digit, three copies of each training digit were created, one for each channel of the RGB color model. Per digit, each RGB-color-channel image was vectorized and vertically stacked to form a 768×1 training vector y_(n)∈

. In FIG. 6, the digits that were identified by method 10 as being anomalies are highlighted with grey bars 18. The artificially-injected anomalies were detected using the robust DL algorithm with parameters λ=1.025, μ=480, and K=100.

The goal of the USPS test was to find the injected anomalies along with other “odd” looking digits in

. The size of the dictionary was set to Q=100 and it was initialized with randomly chosen elements from

. The spatial structure of the digits was captured via an auxiliary graph with N=1,000 nodes. For each node, the Cosine similarities between its image and all other images corresponding to all other nodes were computed. Per node n, a set of K weighted edges was added to the graph, where the chosen edges corresponded to the node pairs {(n, m)}_(m≠n) with the K-largest similarity score. In this experiment, the constrained DL formulation that uses the l₀-“norm” was used in lieu of equation (3). Thus, the solvers used for (6a) and (6b) were modified accordingly. Specifically, orthogonal matching pursuit (OMP) was used to solve (6b) and the constrained set

was dropped from (6a). The desired set of nonzero coefficients used by OMP was set to S₀=40.

FIG. 7 is a graph showing Precision-Recall curves obtained by the robust DL algorithm on the USPS dataset with manually-injected color anomalies. Dashed light-grey lines 20 denote the isolevel lines for various F-score levels, which is defined as the harmonic mean of the precision and recall scores, indexed by f. Various percentages of anomalous images ranging from 1% to 40% were injected into the USPS training set. The parameters λ, μ, and K were tuned so as to try to find all the artificially-added anomalous digits. FIG. 7 shows Precision-Recall curves for the various percentages of injected anomalies. These curves show that precision scores are higher for a broad range of recall scores when a smaller percentage of anomalies are injected. An example of the anomalies detected is shown in FIG. 6. In the instant case, 100 images were colored (10% anomalies injected) and 78 were correctly identified yielding a precision score of 78.00% and recall score of 60.94%.

Dictionary construction method 10 utilizes a robust DL algorithm that leverages known structure among the elements of the training set. The training set structure may be summarized by an auxiliary graph whose connectivity is defined according to the similarity between elements of the training set. Dictionary construction method 10 further uses a BCD solver to learning the dictionary and to identify the outliers. The outlier variables may be updated with a PG algorithm as part of the aforementioned BCD solver. In addition to being applied to images, the method 10 can be applied to other signal domains including video (full motion video, motion imagery, etc.), computer and sensor networks (traffic flows, information flows), social networks, text data, active and passive sonar, audio, etc. Method 10's ability to construct a dictionary from a dataset that includes outliers/anomalies will allow a computer to extract actionable information from a data set faster than previous methods while simultaneously reducing the storage and communications requirements related to sharing and archiving the data.

From the above description of the dictionary construction method 10, it is manifest that various techniques may be used for implementing the concepts of method 10 without departing from the scope of the claims. The described embodiments are to be considered in all respects as illustrative and not restrictive. The method/apparatus disclosed herein may be practiced in the absence of any element that is not specifically claimed and/or disclosed herein. It should also be understood that method 10 is not limited to the particular embodiments described herein, but is capable of many embodiments without departing from the scope of the claims. 

We claim:
 1. A computer-implemented method for constructing a dictionary to succinctly represent data from a training data set comprising the steps of: modeling the data as a linear combination of columns of the dictionary; modeling a presence of outliers in the data set via deterministic outlier vectors that will take nonzero values for data vectors that are deemed outliers only; formatting the training data set in matrix form for processing; defining an underlying structure in the data set; quantifying a similarity across the data according to the underlying structure; building a Laplacian matrix from the matrix-formatted data set, wherein the underlying data structure is captured within the Laplacian matrix; using group-Lasso regularizers to succinctly represent the data as a linear combination of columns of the dictionary; choosing scalar parameters for controlling the number of dictionary columns used to represent the data and the number of elements of the training data set identified as outliers; using block coordinate descent (BCD) and proximal gradient (PG) methods on the vector-matrix-formatted data set to estimate a dictionary that efficiently represents each datum in the training data set as a linear combination of a subset of dictionary columns, corresponding expansion coefficients, and the outlier vectors; using a length of the outlier vectors to identify outliers in the data; removing data identified as outliers from the data set; and using the outlier-free dataset to learn a new dictionary and corresponding vectors of expansion coefficients via the BCD and PG methods with all outlier vectors set to zero.
 2. The method of claim 1, wherein the underlying structure describes a spatiotemporal relationship among data points.
 3. The method of claim 1, wherein the step of formatting the data set in matrix form for processing comprises partitioning and vectorizing the data.
 4. The method of claim 1, wherein the data is video data.
 5. The method of claim 1, wherein the data is imagery data.
 6. The method of claim 1, wherein the data is acoustic data.
 7. The method of claim 1, wherein the data is text data.
 8. The method of claim 1, wherein the data is social network postings.
 9. The method of claim 1, wherein the Laplacian regularizer is defined by the equation: ${{Tr}\left( {OLO}^{\prime} \right)} = {\frac{1}{2}{\sum\limits_{m = 1}^{M}\;\left\lbrack {\sum\limits_{n = 1}^{N}\;{\sum\limits_{n^{\prime} = 1}^{N}\;{w_{n,n^{\prime}}\left( {o_{m,n} - o_{m,n^{\prime}}} \right)}^{2}}} \right\rbrack}}$ where Tr is the trace operator, M is the dimensionality of the training dataset, m is an index ranging between 1 and M, N is the number elements in the training data set, n is an index ranging between 1 and N, n′ is an index ranging between 1 and N, o_(m,n) is the m-th entry of the n-th outlier vector, w_(n,n′) is a non-negative weight corresponding to the similarity between the m-th and the n′-th elements of the data set, O is a matrix of outlier vectors, O′ is the transpose of the matrix of outlier vectors, and L is the Laplacian matrix.
 10. The method of claim 9, wherein the BCD and PG methods used on the vector-matrix-formatted data set is defined as: $\left. {\min\limits_{{D \in \mathcal{D}},S,O}{\frac{1}{2}\sum\limits_{n = 1}^{N}}}\;||{y_{n} - {Ds}_{n} - o_{n}}\mathop{\text{||}}_{2}^{2}{{+ \eta}\sum\limits_{n = 1}^{N}}\;||s_{n}||{}_{1}{+ \lambda}||O||{}_{2,1}{{+ \frac{\mu}{2}}{{Tr}\left( {OLO}^{\prime} \right)}} \right.$ where

is the constraint set for the dictionary, D is the dictionary, S is the matrix of expansion coefficients, s_(n) is the vector of expansion coefficients corresponding to the n-th element of the training set, y_(n) is the n-th element of the training data set, o_(n) is the outlier vector corresponding to the n-th element of the training data set, η is a positive tuning parameter, λ is a positive tuning parameter, and μ is a positive tuning parameter.
 11. The method of claim 1, wherein a plurality of similarities are quantified across the data according to the underlying structure.
 12. The method of claim 10, wherein information regarding the underlying structure is introduced via a robust dictionary learning (DL) algorithm represented by the following iterations: ${\hat{D}}^{(k)} = {\begin{matrix} {\arg\mspace{14mu}\min} \\ {D \in \mathcal{D}} \end{matrix}{f\left( {D,{\hat{S}}^{({k - 1})},{\hat{O}}^{({k - 1})}} \right)}}$ ${\hat{S}}^{(k)} = {\begin{matrix} {\arg\mspace{14mu}\min} \\ S \end{matrix}{f\left( {{\hat{D}}^{(k)},S,{\hat{O}}^{({k - 1})}} \right)}}$ ${\hat{O}}^{(k)} = {\begin{matrix} {\arg\mspace{14mu}\min} \\ O \end{matrix}{f\left( {{\hat{D}}^{(k)},{\hat{S}}^{(k)},O} \right)}}$ where k denotes a BCD-iteration index, and {circumflex over (D)}^((k)), Ŝ^((k)), and Ô^((k)) denote estimates for D, S, and O at iteration k, respectively.
 13. A method for constructing a learned dictionary with a computer to succinctly represent data from a training data set comprising the steps of: utilizing a robust dictionary learning (DL) framework that capitalizes on sparsity-aware modeling tools and a predefined structure among outliers in the data set, wherein the specific outlier structure may be defined via an undirected graph subsuming the similarity among elements of the training data set; introducing information about the outlier structure into the DL framework via a Laplacian regularization term that couples all outlier vector representations; partitioning and vectorizing the training data set in order to format the data in matrix form; using a block coordinate descent (BCD) algorithm coupled with proximal gradient (PG) methods to train the dictionary, estimate corresponding expansion coefficients, and identify the outliers; removing data identified as outliers from the data set; and using the outlier-free dataset to learn a new dictionary and corresponding vectors of expansion coefficients via the BCD and PG methods with all outlier vectors set to zero.
 14. The method of claim 13, wherein the BCD algorithm and PG methods used on the vector-matrix-formatted data set is defined as: $\left. {\min\limits_{{D \in \mathcal{D}},S,O}{\frac{1}{2}\sum\limits_{n = 1}^{N}}}\;||{y_{n} - {Ds}_{n} - o_{n}}\mathop{\text{||}}_{2}^{2}{{+ \eta}\sum\limits_{n = 1}^{N}}\;||s_{n}||{}_{1}{+ \lambda}||O||{}_{2,1}{{+ \frac{\mu}{2}}{{Tr}\left( {OLO}^{\prime} \right)}} \right.$ where

is the constraint set for the dictionary, D is the dictionary, S is the matrix of expansion coefficients, O is a matrix of outlier vectors, s_(n) is the vector of expansion coefficients corresponding to the n-th element of the training set, y_(n) is the n-th element of the training data set, o_(n) is the outlier vector corresponding to the n-th element of the training data set, η is a positive tuning parameter, λ is a positive tuning parameter, μ is a positive tuning parameter, and Tr is the trace operator, N is the number elements in the training data set, n is an index ranging between 1 and N, O′ is a transpose of the matric of outlier vectors, and L is the Laplacian matrix.
 15. The method of claim 14, wherein information regarding the underlying structure is introduced via a robust DL algorithm represented by the following iterations: ${\hat{D}}^{(k)} = {\begin{matrix} {\arg\mspace{14mu}\min} \\ {D \in \mathcal{D}} \end{matrix}{f\left( {D,{\hat{S}}^{({k - 1})},{\hat{O}}^{({k - 1})}} \right)}}$ ${\hat{S}}^{(k)} = {\begin{matrix} {\arg\mspace{14mu}\min} \\ S \end{matrix}{f\left( {{\hat{D}}^{(k)},S,{\hat{O}}^{({k - 1})}} \right)}}$ ${\hat{O}}^{(k)} = {\begin{matrix} {\arg\mspace{14mu}\min} \\ O \end{matrix}{f\left( {{\hat{D}}^{(k)},{\hat{S}}^{(k)},O} \right)}}$ where k denotes a BCD-iteration index, and {circumflex over (D)}^((k)), Ŝ^((k)), and Ô^((k)) denote estimates for D, S, and O at iteration k, respectively. 